package com.example.controller;

import com.example.rabbitmq.ack.direct.DirectSendService;
import com.example.rabbitmq.direct.service.DirectSendMessageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Auther:
 * @Description:
 * @Date: 2019/12/23 16:07
 */
@RestController
@RequestMapping("/DirectSend")
@Api(value = "DirectSendController", description = "DirectSendController")
public class DirectSendController {

    @Autowired
    private DirectSendMessageService directSendMessageService;
    @Autowired
    private DirectSendService directSendService;

    @PostMapping("/sendMessage")
    @ApiOperation(value = "发送消息", notes = "发送消息")
    public String empSelect(String message) {
        String sendMsg = directSendMessageService.sendMsg(message);
        return sendMsg;
    }

    @RequestMapping("/ackSend")
    public String ackSend() {
        directSendService.send("");
        return "ok";
    }


}
